package com.graduation.system.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/*
 * 失物招领实体类 对应数据库表：LOST_AND_FOUND
 *  作者：庄少卿  
 *   时间：10/17
 * */
@Entity
@Table(name = "LOST_AND_FOUND")
@DynamicInsert(true)
@DynamicUpdate(true)
public class SysLostAndFound {
		private Integer arcitleId; //物品ID
		private String arcitleName;  //物品名称
		private java.sql.Timestamp releaseTime;  //发布时间
		private String iteminform; //物品信息
		private String lafIcon; //图片
		private SysDepartment sysDepartment;//发布学校ID department部门表的ID
		private String contactPerson;// 联系人
		private String contactPhone;//联系电话
		private byte mark;//标示：0:我丢失，9:我招领
		private byte status = 9; //状态：0:已处理，9：未处理
		
		
		
		
		@Id
		@Column(name = "ARCITLE_ID",unique = true,nullable = false)
		@GeneratedValue(strategy = GenerationType.AUTO) //自增长
		public Integer getArcitleId() {
			return arcitleId;
		}
		public void setArcitleId(Integer arcitleId) {
			this.arcitleId = arcitleId;
		}

		@Column(name = "LAFIcon")
		public String getLafIcon() {
			return lafIcon;
		}
		public void setLafIcon(String lafIcon) {
			this.lafIcon = lafIcon;
		}
		
		@Column(name = "ARCITLE_NAME",nullable = false)
		public String getArcitleName() {
			return arcitleName;
		}
		public void setArcitleName(String arcitleName) {
			this.arcitleName = arcitleName;
		}

		
		
		@Column(name = "RELEASE_TIME",columnDefinition = "timestamp not null default CURRENT_TIMESTAMP")
		public java.sql.Timestamp getReleaseTime() {
			return releaseTime;
		}
		public void setReleaseTime(java.sql.Timestamp releaseTime) {
			this.releaseTime = releaseTime;
		}
		
		@ManyToOne(targetEntity = SysDepartment.class)
		@JoinColumn(name = "DEP_ID")
		public SysDepartment getSysDepartment() {
			return sysDepartment;
		}
		public void setSysDepartment(SysDepartment sysDepartment) {
			this.sysDepartment = sysDepartment;
		}
		
		@Column(name = "ITEM_INFORM")
		public String getIteminform() {
			return iteminform;
		}
		public void setIteminform(String iteminform) {
			this.iteminform = iteminform;
		}
		@Column(name = "STATUS",nullable = false,columnDefinition = "tinyint default 9")
		public byte getStatus() {
			return status;
		}
		public void setStatus(byte status) {
			this.status = status;
		}
		


		@Column(name = "CONTACT_PERSON",nullable = false)
		public String getContactPerson() {
			return contactPerson;
		}
		public void setContactPerson(String contactPerson) {
			this.contactPerson = contactPerson;
		}
		@Column(name = "CONTACT_PHONE",nullable = false)
		public String getContactPhone() {
			return contactPhone;
		}
		public void setContactPhone(String contactPhone) {
			this.contactPhone = contactPhone;
		}
		@Column(name = "MARK",nullable = false)
		public byte getMark() {
			return mark;
		}
		public void setMark(byte mark) {
			this.mark = mark;
		}


}
